<?php
/**
 * Description of Identical
 *
 * @author      Maciej Zawieja.
 * @link        http://akvus.pl
 * @package     Akvus Framework.
 * @subpackage  Libraries.
 * @copyright   2011 All rights reserved for Maciej Zawieja.
 * @version     1.0.0 - 19.08.2011 (Framework 1.3)
 */
class Identical implements iValidation {

    private $params;

    public function isValid($text) {
        foreach ($this->params as $p) {
            if ($p !== $text)
                throw new ValidationException ('Not identical.', ValidationException::NOT_IDENTICAL);
        }
    }

    /**
     * Specyfy to what the text must be identical.
     * @param array $params Params no limited.
     */
    public function setParams( array &$params ) {
        $this->params = $params;
    }

    function Params( array $params = null )
    {
        if ($params === null) return $this->params;
        $this->param = $params;
        return $this;
    }
}